<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // xhr
        const xhr = new XMLHttpRequest();
        // 建立链接
        xhr.open('get','xxxxx');
        // 发送请求
        xhr.send();
        // 监听状态
        xhr.onreadystatechange = function(){
            // 0- 4
            if(xhr.readyState === 4){
                if(xhr.status >=200 && xhr.status < 300){
                    // 响应体
                    xhr.response
                }
            }
        }
    </script>
</body>
</html>